<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@page isELIgnored="false"%> 

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>超市账单管理系统</title>
    <link rel="stylesheet" href="css/public.css"/>
    <link rel="stylesheet" href="css/style.css"/>
<script type="text/javascript" src="js/jQuery-1.8.3.js"></script>
</head>
<body>
<!-- 添加成功 -->
<c:if test="${! empty fankui}">
	<script type="text/javascript">
		alert("${fankui}");
	</script>
	<c:remove var="fankui" />
</c:if>
 <%@include file="head.jsp" %>
 <div class="right">
            <div class="location">
                <strong>你现在所在的位置是:</strong>
                <span>账单管理</span>
            </div>
             <form action="findBill.csdd">
            <div class="search">
                <span>商品名称：</span>
                <input type="text" name="billname" value="${bname}" placeholder="请输入商品的名称"/>
                
                <span>供应商：</span>
                <select name="tigong" >
                 <option value="">--请选择--</option> 
                <c:forEach var="p" items="${providerall }">
                <option value="${p.id }">${p.proName }</option>
                
                </c:forEach>
             
                </select>

                <span>是否付款：</span>
                <select name="fukuan">
                    <option value="">--请选择--</option>
                    <option value="2">已付款</option>
                    <option value="1">未付款</option>
                </select>

                <input type="submit" value="查询"/>
                <a href="intoaddBill.csdd">添加订单</a>
               </form>
            </div>
            <!--账单表格 样式和供应商公用-->
            <table class="providerTable" cellpadding="0" cellspacing="0">
                <tr class="firstTr">
                    <th width="10%">账单编码</th>
                    <th width="20%">商品名称</th>
                    <th width="10%">供应商</th>
                    <th width="10%">账单金额</th>
                    <th width="10%">是否付款</th>
                    <th width="10%">创建时间</th>
                    <th width="30%">操作</th>
                </tr>
                <c:forEach var="b" items="${findbill.datas }">
                <tr>
                    <td>${b.billCode }</td>
                    <td>${b.productName }</td>
                    <td>${b.providerName}</td>
                    <td>&yen;：${b.totalPrice}</td>
                    <td>${b.isPaymentst }</td>
                    <td>${b.creatDate}</td>
                    <td>
                        <a href="findbill.csdd?id=${b.id }&why=view"><img src="img/read.png" alt="查看" title="查看"/></a>
                        <a href="findbill.csdd?id=${b.id }&why=update"><img src="img/xiugai.png" alt="修改" title="修改"/></a>
                        <a href="delbill.csdd?id=${b.id }" class="removeBill"><img src="img/schu.png" alt="删除" title="删除"/></a>
                    </td>
                </tr>
             </c:forEach>
            </table>
            <c:if test="${ findbill.pageNo>1}">
        <a href="findBill.csdd?p=${findbill.pageNo - 1}&billname=${bname}&fukuan=${fukuan}&tigong=${tigong}">上一页</a>
        </c:if>
        ${findbill.pageNo }/${findbill.pageNums}
        <c:if test="${findbill.pageNums > findbill.pageNo}">
        <a href="findBill.csdd?p=${findbill.pageNo + 1}&billname=${bname}&fukuan=${fukuan}&tigong=${tigong}">下一页</a>
        </c:if>
        </div>
    </section>

<!--点击删除按钮后弹出的页面-->
<div class="zhezhao"></div>
<div class="remove" id="removeBi">
    <div class="removerChid">
        <h2>提示</h2>
        <div class="removeMain">
            <p>你确定要删除该订单吗？</p>
            <a href="#" id="yes">确定</a>
            <a href="#" id="no">取消</a>
        </div>
    </div>
</div>

    <footer class="footer">
        版权归北大青鸟
    </footer>

<script src="js/jquery.js"></script>
<script src="js/js.js"></script>
<script src="js/time.js"></script>
<script type="text/javascript">
	$(function(){
		$(":input[name=fukuan]").val('${fukuan}');
		$(":input[name=tigong]").val('${tigong}');
	});
</script>
</body>
</html>